package com.xbongbong.pro.aiassistant.service;

import com.alibaba.fastjson.JSONObject;
import com.xbongbong.paas.domain.entity.ext.PaasFormDataEntityExt;
import com.xbongbong.paas.toolbox.exception.XbbException;
import com.xbongbong.pro.domain.entity.AiAssistantHistoryEntity;
import com.xbongbong.pro.message.pojo.dto.MessageRabbitMqDTO;
import com.xbongbong.pro.smartsettings.pojo.SsExecutorPojo;
import com.xbongbong.pro.smartsettings.pojo.SsHistoryValidPojo;
import com.xbongbong.pro.smartsettings.pojo.SsMessageMergePojo;
import com.xbongbong.pro.smartsettings.pojo.dto.SmartStrategyRabbitMqDTO;
import com.xbongbong.pro.sms.pojo.SmsReceiverPojo;

import java.util.List;
import java.util.Map;

/**
 * @description: 智能助手--数据分发&记录入库
 * @Author: hongxiao
 * @date: 2019-05-16 10:56
 * @since v1.0
 */
public interface SsDistributeSaveService {
    /**
     * 执行数据分发&记录数据入库
     * @param rabbitMqDTO 智能助手列表
     * @param validHistoryList 记录数据
     * @param saasDataList saas表单数据
     * @param paasDataList paas表单数据
     * @param messageMergeList 短信数据
     * @param executorList 执行人
     * @param workReportValidListMap 工作报告有效数据
     * @param workReportExecutorListMap 工作报告执行人
     * @param isTest 是否为测试：默认正式
     * @param testMessageMap 消息数据
     * @param testCommunicatePlanMap 访客计划数据
     * @param testSmsMap 短信数据
     * @param noSaveDistribution 是否保存和分发数据
     * @return
     * @throws
     * @author hongxiao
     * @date 2019-05-16 10:59
     * @since v1.0
     * @version v1.0
     */
    void distributeAndSave(SmartStrategyRabbitMqDTO rabbitMqDTO, List<SsHistoryValidPojo> validHistoryList,
                           Map<Integer, List<PaasFormDataEntityExt>> saasDataList, List<PaasFormDataEntityExt> paasDataList,
                           List<SsMessageMergePojo> messageMergeList, List<SsExecutorPojo> executorList,
                           Map<Long, SsExecutorPojo> workReportExecutorListMap, Map<Long, List<AiAssistantHistoryEntity>> workReportValidListMap,
                           Boolean isTest, Map<Long, List<MessageRabbitMqDTO>> testMessageMap,
                           Map<Long, List<Map<String, String>>> testCommunicatePlanMap,
                           Map<Long, List<SmsReceiverPojo>> testSmsMap, boolean noSaveDistribution) throws XbbException;
    /**
     * 获取名称attr
     *
     * @param businessType 业务类型
     * @return
     * @throws
     * @author hongxiao
     * @date 2019-12-03 14:35
     * @version v1.0
     * @since v1.0
     */
    String getNameAttr(Integer businessType);
    /**
     * 占位符替换
     *
     * @param content     内容
     * @param placeHolder 占位符
     * @param size        数量
     * @param nameAttr    名称attr
     * @return
     * @throws
     * @author hongxiao
     * @date 2019-12-03 20:44
     * @version v1.0
     * @since v1.0
     */
    String handleContentPlaceholder(String content, String placeHolder, Integer size, String nameAttr);

    /**
     * 获取客户第一个手机号
     *
     * @param dataList 业务数据
     * @return
     * @throws
     * @author hongxiao
     * @date 2019-05-17 17:09
     * @version v1.0
     * @since v1.0
     */
    String getCustomerFirstMobile(JSONObject dataList);
}
